<div class="padding">
    <div class="toolbar f14 mt25 clearfix">
        <div class="toolbar-tab fl">
            <div material-ul active-li="img-text"></div>
        </div>
    </div>
    <div class="breadcrumbs">
        <a href="#/material" class="icon-merge icon-goback" title="返回上一层">返回上一层</a>
        <a href="#/material" class="parent">图文消息</a> /
        <span>{{handleType == 'add'?'新建图文消息' : '修改图文消息'}}</span>
    </div>

        <div class="clearfix">
            <div class="upload-preview multi pull-left">
                <div class="list-wrap">
                    <div class="news-list" style="position: relative;">
                        <div class="imgtext" ng-repeat="article in imgText.articles" >
                            <div class="img-row clearfix">
                                <div class="img-cover">
                                    <img ng-src="{{article.cover_url}}" ng-show="!!article.cover_url" style="width:100%;height: 100%"/>
                                    {{!!article.cover_url?'' : '封面图片'}}
                                </div>
                                <h4 class="news-title">
                                    {{!!article.title ?article.title : '标题'}}
                                </h4>
                            </div>
                            <div class="img-mask">
                                <a href="javascript:;" class="edit" ng-click="changeActicle($index,$event)"></a>
                                <a href="javascript:;" class="del" ng-show="$index>0" ng-click="deleteActicle($index)"></a>
                            </div>
                        </div>
                    </div>
                    <div class="plus" ng-click="addArticle()">
                        <a href="javascript:;" class="add">
                            <span class="add-icon"></span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="form-content pull-right" ng-controller="articleController" ng-repeat="article in imgText.articles" ng-show="$index == currArticleIndex">
                <form class="form form-preview" name="imgTextForm">
                    <span class="icon-merge trigon"></span>
                    <input type="hidden" value="">
                    <div class="form-group">
                        <label>标题<em class="sign c-red">*</em></label>
                        <input type="text" class="form-control" name="title" ng-model="article.title" required="" ng-maxlength="64">
                        <div ng-messages="imgTextForm.title.$error"
                             ng-show="imgTextForm.$submitted || imgTextForm.title.$touched">
                            <p class="error c-red" ng-message="required">标题不能为空。</p>
                            <p class="error c-red" ng-message="maxlength">标题长度不能超过64字。</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="author">作者<span class="gray">（选填）</span></label>
                        <input type="text" class="form-control" id="author" name="author" value="" ng-model="article.author">
                    </div>
                    <div class="form-group">
                        <label for="cover_url">封面<em class="sign c-red">*</em><span class="gray">（大图片建议尺寸：900像素 * 500像素）</span></label>
                        <input type="hidden" id="cover_url" name="cover_url" value="">
                        <input type="hidden" id="cover_name" name="cover_name" value="">
                        <div class="upload-wrap" id="upload_wrap" style="position: relative;">
                            <div class="button-area">
                                <button class="btn-pr sub-btn bg-orange c-white" id="upload_btn" style="position: relative;">上传</button>
                                <!--<input type="file" accept="image/*" class="uploadFile l0 " nv-file-select uploader="uploader">-->
                                <button type="button" class="btn-pr sub-btn" id="img_lib_btn"
                                        ui-dialog="选择图片"
                                        ui-dialog-before-show="showImages($dialogScope)"
                                        ui-dialog-ok="okImages($dialogScope)"
                                        ui-dialog-cache="false"
                                        ui-dialog-url="business_modules/material/ngviews/img_text_image.html">从图片库选择</button>
                                <div class="process"></div>
                            </div>
                            <div class="preview-area">
                                <div class="js_cover upload_preview" ng-show="!!article.cover_url">
                                    <img ng-src="{{article.cover_url}}">
                                    <a class="js_removeCover del-pic" href="javascript:void(0);" ng-click="article.cover_url = ''">删除</a>
                                </div>
                            </div>
                            <div class="moxie-shim moxie-shim-html5" style="position: absolute; top: 0px; left: 0px; width: 100px; height: 32px; overflow: hidden; z-index: 0;">
                                <input type="file" name="cover_url" required="" nv-file-upload="image" nv-file-upload-options="uploaderOptions"  style="font-size: 999px; opacity: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; cursor: pointer;" multiple="" accept="image/jpeg,image/png,image/gif,image/bmp">
                            </div>
                        </div>
                        <label class="form-checkbox" id="show_cover" ng-class="{'selected':article.is_cover_showin_body!='0'}" ng-click="changeIsCoverShowinBody(article)" >
                            <i class="icon-checkbox"></i>
                            <span class="align-m gray">封面图片显示在正文中</span>
                        </label>
                        <div
                             ng-show="imgTextForm.$submitted && !article.cover_url">
                            <p class="error" >必须插入一张图片。</p>
                        </div>
                    </div>
                    <div class="form-group summary">
                        <label for="summary">摘要<span class="gray">（选填，该摘要只在发送图文消息为单条时显示）</span></label>
                        <textarea name="summary" id="summary" class="form-control" style="height: 100px;" maxlength="120" ng-model="article.summary"></textarea>
                    </div>
                    <div class="form-group">
                        <label  style="display: block">正文<em class="sign c-red">*</em></label>
                        <!--<div class="ueditor" ng-model="article.body" ueditor></div>-->
                        <div name="body" ng-model="article.body" ueditor></div>
                        <!--<textarea name="body" id="body" ng-model="article.body"></textarea>-->
                        <button type="button" class="hide" id="ueditor_image"
                                ui-dialog="选择图片"
                                ui-dialog-before-show="showImages($dialogScope)"
                                ui-dialog-ok="okUeditorImages($dialogScope)"
                                ui-dialog-cache="false"
                                ui-dialog-url="business_modules/material/ngviews/img_text_image.html">从图片库选择</button>
                        <div
                             ng-show="imgTextForm.$submitted && !article.body">
                            <p class="error" >正文不能为空。</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="original_url">原文链接<span class="gray">（选填）</span></label>
                        <input type="url" class="form-control" id="original_url" name="original_url" ng-model="article.original_url">
                        <div ng-messages="imgTextForm.original_url.$error"
                             ng-show="imgTextForm.$submitted || imgTextForm.original_url.$touched">
                            <p class="error" ng-message="url">链接不合法。</p>
                        </div>
                    </div>
                </form>
            </div>

        </div>

        <div class="form-bottom align-c">
            <button type="button" class="btn-pr ok-btn" id="save_btn" ng-click="addOrUpdateImgText(false)">保存</button>
            <!--                    <button type="button" class="btn-pr normal-btn" id="preview_btn">预览</button>-->
            <button type="button" class="btn-pr normal-btn" id="save_send_btn" ng-click="addOrUpdateImgText(true)">保存并群发</button>
        </div>


</div>